package observerpattern;

/**
 * 具体观察者实现类
 * Created by hongc on 2017/2/26 0026.
 */
public class ConcreteObserver implements Observer {
    //用于同步目标的状态
    private String observerState;

    /**
     * 获取目标类状态,传给观察者
     * @param subject
     */
    @Override
    public void update(Subject subject) {
        observerState = ((ConcreteSubject)subject).getSubjectState();
        //todo：具体实现类的业务逻辑
    }
}
